﻿using System;
using System.Configuration;
using System.IO;
using EPiServer.Configuration;
using EPiServer.Core;
using EPiServer.DataAccess;
using EPiServer.Tests.Environment;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TemplateFoundation.Tests.Environment;

namespace EPiServer.Tests.UnitTests
{
    /// <summary>
    /// Base class for EPiServer unit tests
    /// </summary>
    [TestClass]
    public abstract class EPiServerUnitTest
    {
        /// <summary>
        /// Starts EPiServer CMS
        /// </summary>
        /// <param name="context"></param>
        [AssemblyInitialize]
        public static void Initialize(TestContext context)
        {
            EPiServerInitializer.Initialize(context);
        }

        /// <summary>
        /// Cleans up after EPiServer CMS unit tests
        /// </summary>
        /// <param name="context"></param>
        [AssemblyCleanup]
        public static void Cleanup()
        {
            EPiServerInitializer.Cleanup();
        }

        /// <summary>
        /// Gets or sets the test context (the context is set automatically by the test framework)
        /// </summary>
        public TestContext TestContext { get; set;}
    }
}
